﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;

namespace MVC4CodeSamples.Areas.HTMLHelpers.Models
{
    public class Employee
    {
        [Key] 
        public int EmpID { get; set; }
        public string EmpName { get; set; }
        public int EmpSalary { get; set; }
        public bool  IsFullTime { get; set; }
        public DateTime DOB { get; set; }
        public Employee(int empID, string empName, int empSalary)
        {
            this.EmpID = empID;
            this.EmpName = empName;
            this.EmpSalary = empSalary;
            IsFullTime = true;
            DOB = Convert.ToDateTime("10/10/1080");
        }
        public Employee()
        {
          
        }
    }


    public class EmployeeDBContext : DbContext
    {
        public List<Employee> Employees { get; set; }

        public EmployeeDBContext()
        {
            // Add Sample Data 
            if (Employees==null)
            {
                Employees = new List<Employee>();
            }
            Employees.Add(new Employee(1,"John", 1000));
            Employees.Add(new Employee(2, "Ria", 3333));
            Employees.Add(new Employee(3, "Silpi", 1004));
            Employees.Add(new Employee(4, "Koyal", 5555));
        }
    }
}